<?php

function f_post($url, $data) {
    $intTimeStart = microtime(true);
    $logString = 'Posting:' . $url;
    $post_variables = $data;
    $content = http_build_query($post_variables);
    $content_length = strlen($content);
    $options = array(
        'http' => array(
            'method' => 'POST',
            'header' => "Content-type: application/x-www-form-urlencoded\r\n" .
            "Content-length: $content_length\r\n",
            'content' => $content,
            'timeout' => 60,
        )
    );
    $context = stream_context_create($options);
    $s = file_get_contents($url, false, $context);
    $intTimeEnd = microtime(true);
    $logString.='|RequestTime:' . ($intTimeEnd - $intTimeStart) . 's';
    log::n($logString . '|http_response_header:' . $http_response_header[0]);
    return $s;
}

?>